package com.tnr.scgcxx.controller.info;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.tnr.scgcxx.model.Color;
import com.tnr.scgcxx.service.info.ColorService;

@Controller @RequestMapping("/info")
public class CoView {
	
	
	@Resource
	private ColorService colorService;
	
	@RequestMapping(value="/color_to",method=RequestMethod.GET)
	public String colorTo() {
		return "info/color";
	}
	
	@GetMapping("/color_add_to")
	public String colorAddTo() {
		return "info/color_add";
	}
	
	@GetMapping("/color_upd_to")
	public String colorUpdTo(String co_id,Model model) {
		Color co=colorService.getColor(co_id);
		model.addAttribute("co", co);
		return "info/color_upd";
	}
	
}
